<template>
  <div>
    <button @click="unbindWeChatFn">解绑微信</button>
  </div>
</template>

<script>
import { UnBindWeChatAPI } from "../../request/api";
import { mapActions } from "vuex";

export default {
  methods: {
    ...mapActions({
      asyncChangeToast: "showToast/asyncChangeToast",
    }),
    async unbindWeChatFn() {
      let res = await UnBindWeChatAPI();
      if (!res) {
        return;
      }
      if (res.code == 0) {
        //提示: 微信解绑成功
        this.asyncChangeToast({
          // 是否显示提示框
          isShowToast: true,
          // 提示内容
          toastMsg: "微信解绑成功",
          // 提示类型 success成功 error错误 warning警告
          toastType: "success",
        });
      }
    },
  },
};
</script>

<style>
</style>